package router

import (
	jwt "gitee.com/sansaniot/ssiot-core/httpmvc/jwtauth"
	"github.com/gin-gonic/gin"

	"ssforward/internal/forward/apis"
)

func init() {
	RouterCheckRole = append(RouterCheckRole, registerForwardServerRouter)
}

func registerForwardServerRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.ForwardServer{}
	r := v1.Group("/api/forward/server").Use(authMiddleware.MiddlewareFuncWithOutValidate())
	{
		r.GET("/find", api.FindList)
		r.GET("/get", api.FindOne)
		r.POST("/add", api.AddServerInfo)
		r.POST("/modify", api.EditServerInfo)
		r.POST("/remove", api.DeleteServerInfo)
		r.POST("/test", api.TestServerInfo)
	}
}
